/*
Name: Kabir Kang
File: unittest3.c
Date: 7/13/14
Summary: tests supplyCount()
 */
#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include "rngs.h"

int main() 
{
  struct gameState g;
  int numPlayer = 2;
  int cardsInHand, i, s;
  int seed = 100;
  int k[10] = {adventurer, council_room, feast, gardens, mine, remodel, smithy, village, baron, great_hall};
  
  memset(&g, 23, sizeof(struct gameState));
  initializeGame(numPlayer, k, seed, &g);

  for (i = 0; i<10; i++)
    {
      g.supplyCount[k[i]] = 10;
      s = supplyCount(k[i], &g);
      if(s == 10)
	{
	  printf("supplyCount(): PASS when using a value of 10. \n");
	}
      else
	{
	  printf("supplyCount(): FAIL when card %d uses values of 10. \n",k[i]); 
	}
    }
  
  for (i=0; i<10; i++)
    {
      g.supplyCount[k[i]] = 40;
      s = supplyCount(k[i], &g);
      if(s == 40)
        {
          printf("supplyCount(): PASS when using a value of 40. \n");
        }
      else
        {
          printf("supplyCount(): FAIL when card %d uses values of 40. \n",k[i]);
        }

    }
  
  for (i=0; i<10; i++)
    {
      g.supplyCount[k[i]] = 80;
      s = supplyCount(k[i], &g);
      if(s == 80)
        {
          printf("supplyCount(): PASS when using a value of 80. \n");
        }
      else
        {
          printf("supplyCount(): FAIL when card %d uses values of 80. \n",k[i]);
        }

    }
  
  for (i=0; i<10; i++)
    {
      g.supplyCount[k[i]] = 640;
      s = supplyCount(k[i], &g);
      if(s == 640)
        {
          printf("supplyCount(): PASS when using a value of 640. \n");
        }
      else
        {
          printf("supplyCount(): FAIL when card %d uses values of 640. \n",k[i]);
        }

    }
}
